package com.yujistu.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.yujistu.App;
import com.yujistu.R;
import com.yujistu.adapter.BaseListAdapter;
import com.yujistu.view.GalleryView;

import java.util.ArrayList;

/**
 * Created by S3YOGA on 2015/11/4.
 */
public class HomeFragment extends BaseFragment {


    RelativeLayout homeGalleryRL;
    GalleryView    mGalleryView;

    private View  mContentView;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        mContentView = inflater.inflate(R.layout.fragment_home, container, false);
        mGalleryView = new GalleryView(getActivity());

        initView();

        return mContentView;
    }

    private void initView() {
        titleView = (TextView) mContentView.findViewById(R.id.tv_title_title);
        titleView.setVisibility(View.VISIBLE);
        titleView.setText(R.string.yuji);

        ArrayList<String>  mGalleryList = new ArrayList<>();
        mGalleryList.add(" ");
        mGalleryView.setParams(mGalleryList);
        mGalleryView.setOnGalleryIntentListener(new GalleryView.onGalleryIntentListener() {
            @Override
            public void intentToActivity(int position) {
                // App.showToastShort(position + "被点击!!!!!");
            }
        });

        homeGalleryRL = (RelativeLayout)mContentView.findViewById(R.id.home_galleryRll);
        homeGalleryRL.addView(mGalleryView);
    }

    @Override
    public int getLayoutId() {
        return 0;
    }

    TextView titleView;

    @Override
    public void initView(View view) {


    }

    @Override
    public BaseListAdapter getListAdapter() {
        return null;
    }

}
